<html>
<head>
<link rel="stylesheet" type="text/css" href="../resources/stylesheets/commonStyle.css">
<script type="text/javascript" src="../resources/js/common.js"></script>
<script type="text/javascript">
var xmlHttp;
function domainOnChange(){
	  var domainName=document.getElementById("domain").value;
	  //alert(domainName);
	  var url="AjaxController.do?domainName="+domainName;
	  startRequest(url,domainName);
	  return true;
}

function createXMLHttpRequest(){
	  if(window.ActiveXObject){
	  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	   }
	   else if(window.XMLHttpRequest){
	    xmlHttp=new XMLHttpRequest();

	   }
	   return true;
	  }

function startRequest(url,value){
	  createXMLHttpRequest();
	  xmlHttp.onreadystatechange=function()
 		 {
  			if (xmlHttp.readyState==4 && xmlHttp.status==200)
   			 {
    			document.getElementById("sub_domain").innerHTML=xmlHttp.responseText;
   			 }
 		 }
	  xmlHttp.open("GET",url,true);
	  xmlHttp.send(null);
	  return true;
	  }
/* //JavaScript Validation for name and contact  number feild//
function validateUser(){
	var userName=document.getElementById("username").value;
	var userContact=document.getElementById("contact").value;


	if(userName==""){
		alert("Please enter User Name");
		document.getElementById("username").focus();
	}

	if(userContact==""){
		alert("Please enter Contact Number");
		document.getElementById("contact").focus();
		return false;
	}if (!(isNumeric(userContact) && userContact.length ==10 ))
    {
        alert("Mobile Number Should be in 10 digits only");
               return false;
    }
	document.registration.submit();

}

function isNumeric(n) {
	  return !isNaN(parseFloat(n)) && isFinite(n);
	}
 */
</script>
</head>
<body>
<%@ include file="header.jsp" %>

<div id="nav">

</div>

	<div id="nav">

	</div>
	<div id="section">
	<h3 align="justify" >User Registration</h3>
	<form method="post" action="userAction.do" name="registration">
	<input type="hidden" name="pageName" value="registerUser">
	<table style="width:100%">

	<tr>
		<td class="required">Name</td>
		<form action="userAction.do" method="post">
		<td> <input type="text" name="name" required id="username"></td>
		</form>
	</tr>
<tr>
		<td class="required">Contact</td>
		<form action="userAction.do" method="post">
		<td> <input  name="contact" required id="contact"  ></td>
		</form>
	</tr>
	<tr>
		<td class="required">Role</td>
		<td> <select name="role">
  			<option value="1"selected="selected">Manager </option>
  			<option value="2">Sub-domain Lead</option>
  			<option value="3">Solution Owner</option>
			<option value="4">Employee</option>
  		</select></td>
	</tr>
	<tr>
	<tr>
		<td class="required">Domain</td>
		<td> <select name="domain" id="domain" onchange="domainOnChange()">
  			<option value="MNA" id="MNA" selected="selected">MNA</option>
		</select></td>
	</tr>
	<tr>
		<td class="required">Sub-Domain</td>

		<td> <select name="sub_domain" id="sub_domain" >
			<option value="1"selected="selected">MPS </option>
  			<option value="2">MIO</option>
  			<option value="3">MSP</option>
			<option value="4">MSDP</option>
			<option value="5">Others</option></select> </td>
  		<!-- <p id="sub_domain"></p></td> -->

	</tr>
	<tr>
		<td>Primary Skills</td>
		<td> <i><textarea name="primarySkill" rows="2" cols="20" ></textarea></i></td>

	</tr>
	<tr>
		<td>Secondary Skills</td>
		<td> <select name="secondarySkill">

  			<option value="MSP"selected="selected">MSP</option>
  			<option value="MPS">MPS</option>
  			<option value="MSDP">MSDP</option>
			<option value="MiO">MiO</option>

		</select></td>
	</tr>
     <tr>
     <td></td>
		<td align="left"><input type="button" value="Create User" class="btn" onclick="javascript:validateUser()">
		<input type="reset" value="Reset User" class="btn"></td>
	</tr>
	</table>
	</form>
	</div>
<!-- <img src="../resources/image/eri.jpg"  width="500" height="500" align="right">-->
	<%@ include file="footer.jsp" %>
	</body>
</html>
